<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html>
<html lang="zh-cn">
<head>
 	<%@ include file="../head.jsp" %>
</head>
<body class="vday home">
	<div id="page">
	<%@ include file="../global_navi.jsp" %>
	<%@ include file="../aos_header.jsp" %><!-- 如果需要查询，要自定义aos_header -->
	<%@ include file="../guide.jsp" %><!-- 动态向导栏，需要后台 -->
	<div id="primary">
		<div id="primary_main" role="main">
			<div class="module footerblock">
				<h2><span>宝贝组列表</span></h2>
				<c:if test="${fn:length(actList) == 0}">
					<span style="padding-left: 10px;">没有创建宝贝!</span>
				</c:if>

				<c:forEach items="${actList }" var="actBean" varStatus="actStatus">
					<div class="modulecontent">
						<div id="store_details">
							<img type="local" alt="items" src="/resource/i001.jpg" id="img_${actBean.aid}" />
						</div>
						<div id="store_updates">
							<h2>
								<a href="/activity/act_${actBean.aid }" onclick="singleLoading();">
									<strong>
										<c:out value="${actBean.aname }"></c:out>
									</strong>
								</a>
								<font color="#999">[
									<c:forEach items="${actSettingList }" var="actSetting">
										<c:if test="${actSetting.id == actBean.modleId}">
										${actSetting.name }
										</c:if>
									</c:forEach>]
								</font>
							</h2>
							<br/>
							<br/>
							活动时间:&nbsp;&nbsp;&nbsp;&nbsp;
							<fmt:formatDate value="${actBean.beginTime }" pattern="yyyy-MM-dd HH:mm:ss"/>
							~
							<fmt:formatDate value="${actBean.endTime }" pattern="yyyy-MM-dd HH:mm:ss"/>
							<!-- 
							<font color="green">
								<c:choose>
									<c:when test="${actBean.status == 0}">未开始</c:when>
									<c:when test="${actBean.status == 1}">进行中</c:when>
									<c:when test="${actBean.status == 2}">已结束</c:when>
									<c:when test="${actBean.status == 3}">活动暂停</c:when>
									<c:when test="${actBean.status == 4}">活动废弃</c:when>
									<c:otherwise>状态未知</c:otherwise>
								</c:choose>
							</font>
							-->
							<br/>
							<br/>
							宝贝数量:&nbsp;&nbsp;&nbsp;&nbsp;<c:out value="${actBean.xpddItemSize }"></c:out>件
							<br/>
							<br/>
							创建人:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<c:out value="${actBean.nick }" ></c:out>
							<br/>
							<br/>
							参与人次:&nbsp;&nbsp;&nbsp;&nbsp;<c:out value="${actBean.userSize }"></c:out>人次
							<!-- <c:out value="${actBean.dealNum }"></c:out>人次成交 -->
						</div>
					</div>
				</c:forEach>
				<div class="module_btm">&nbsp;</div>
			</div>
		</div>
		<div id="secondary" class="rail">
			<div role="navigation" aria-label="New Items" class="box navigation-list new-to-store" id="rili">
				<div class="title-bar">
					<h2>日历</h2>
				</div>
				<div class="box-content clearfix">
					<div class="list_content" id="datepicker">
					</div>
				</div>
				<div class="bottom-corners"></div>
			</div>
			<div class="box navigation-list top-sellers">
				<div class="title-bar">
					<h2>分类</h2>
				</div>
				<div class="box-content clearfix">
					<div class="list_head">
						<h3><span>参数模版</span></h3>
					</div>
					<div class="list_content">
						<ul class="ordered">
							<c:forEach items="${actSettingList}" var="setting">
								<li>
									<a href="/activity/showByModel_${setting.id}" onclick="singleLoading();" >
										<span>${setting.name }</span>
									</a>
								</li>
							</c:forEach>
						</ul>
					</div>
				</div>
				<div class="bottom-corners"></div>
			</div>
			<div class="module footerblock"></div>
		</div>
	</div>
	<%@ include file="../left_navi.jsp" %>
	<%@ include file="../footer.jsp" %>
	</div>
<script type="text/javascript">
//<![CDATA[
jQuery(document).ready(function(){
	//设置当前路径
	jQuery("#breadcrumb").append('<li><span>:&nbsp;&nbsp;宝贝组信息</span></li>');
	jQuery("#datepicker").datepicker({
		monthNamesShort : ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'],
		monthNames : ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'],
		dayNamesMin: ['日', '一', '二', '三', '四', '五', '六'],
		dayNamesShort : ['日', '一', '二', '三', '四', '五', '六'],
		dayNames : ['日', '一', '二', '三', '四', '五', '六']
	});
	jQuery(".ui-datepicker").css("width", "160px");

	//设置宝贝图片
	getAllURL();
});
function getAllURL()
{
	var ids = new Array();
	//获取所有宝贝的id
	jQuery("img[type]").each(function(i){
		var tid = this.id.split("_")[1];
		ids.push(tid);
	});
	//如果没有宝贝,不查询
	if (ids.length <= 0)
	{
		return false;
	}

	jQuery.ajax({
		url : '/activity/getURL',
		contentType : 'application/json',
		type : "GET",
		dataType : 'json',
		data : {
			"ids" : ids.toString()
		},
		beforeSend : function (XMLHttpRequest) {
		    //this;// 调用本次AJAX请求时传递的options参数
		},
		complete : function (XMLHttpRequest, textStatus) {
		    //this; // 调用本次AJAX请求时传递的options参数
		},
		error : function (XMLHttpRequest, textStatus, errorThrown) {
		    // 通常 textStatus 和 errorThrown 之中
		    // 只有一个会包含信息
		    //this; // 调用本次AJAX请求时传递的options参数
			return false;
		},
		success : function (data, textStatus) {
		    // data 可能是 xmlDoc, jsonObj, html, text, 等等...
		    var tmpData = data;//eval( "(" + data + ")");
	    	jQuery("img[type]").each(function(i){
	    		var tid = this.id.split("_")[1];
	    		if (tmpData[tid] != "")
    			{
		    		this.src = tmpData[tid];
    			}
	    		//jQuery(this.id).load(tmpData[tid]);
	    	});
		    //this; // 调用本次AJAX请求时传递的options参数
		}
	});
}
function singleLoading(){
    jQuery("#nyroDiv a").nmCall();
}
//]]>
</script>
</body> 
</html> 
 